package com.yaodian100.ec.rank.entity;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;

@Entity
@Table(name = "EC_REPORT_PRODUCT_CLICK")
@NamedQueries({
			@NamedQuery(name = "ReportProductClick.updateSortByProductIdAfterDate", query = 
			"UPDATE ReportProductClick report SET report.sort=:sort WHERE report.primaryKey.productId=:productId AND report.primaryKey.computeDate>=:computeDate")
			,@NamedQuery(name = "ReportProductClick.updateSortByCategoryIdAfterDate", query = 
			"UPDATE ReportProductClick report SET report.sort=:sort WHERE report.primaryKey.categoryId=:categoryId AND report.primaryKey.computeDate>=:computeDate")
			,@NamedQuery(name = "ReportProductClick.updateSortByProductCategoryIdAfterDate", query = 
			"UPDATE ReportProductClick report SET report.sort=:sort WHERE report.primaryKey.categoryId=:categoryId AND report.primaryKey.productId=:productId AND report.primaryKey.computeDate>=:computeDate")
			,@NamedQuery(name = "ReportProductClick.deleteByProductCategoryIdAfterDate", query = 
			"DELETE FROM ReportProductClick report WHERE report.primaryKey.categoryId=:categoryId AND report.primaryKey.productId=:productId AND report.primaryKey.computeDate>=:computeDate")
		})
public class ReportProductClick {
	
	@EmbeddedId
	private ReportProductClickPrimaryKey primaryKey;
	
	@Column(name = "CLICK")
	private Long click;
	
	@Column(name = "MANUAL_SORT")
	private Long sort;
	
	public ReportProductClick() {
		setPrimaryKey(new ReportProductClickPrimaryKey());
	}

	public ReportProductClickPrimaryKey getPrimaryKey() {
		return this.primaryKey;
	}
	public void setPrimaryKey(ReportProductClickPrimaryKey primaryKey) {
		this.primaryKey = primaryKey;
	}

	public Long getClick() {
		return this.click;
	}
	public void setClick(Long click) {
		this.click = click;
	}

	public Long getSort() {
		return this.sort;
	}
	public void setSort(Long sort) {
		this.sort = sort;
	}
	
}
